<?php
namespace App\Models;

/*
 * Mock travel destination data.
 * Note that we don't have to extend CodeIgniter's model for now
 */

class Places {

    //mock data : an array of records
    protected $data = [
        '1' => [
            'id' => 1,
            'name' => 'Shi Zhengliang',
            'Ethnic '=>'Han ',
            'Native-place' => 'Sichuan Province',
            'birth'=>'1946 ',
            'representative-works' => 'Taibai poetry banquet',
            'height' => '186',
            'Gender '=>'male',
            'professional-position'=>'chef',
        ],
        '2' => [
            'id' => 2,
            'name' => 'Gao Bingyi',
            'Ethnic '=>'Han ',
            'Native-place' => 'Shandong Province',
            'birth'=>'1946 ',
            'representative-works' => 'Taibai poetry banquet',
            'height' => '179',
            'Gender '=>'male',
            'professional-position'=>'chef',
        ],
        '3' => [
            'id' => 3,
            'name' => 'Yang Guanyi',
            'Ethnic '=>'Han ',
            'Native-place' => 'GuangDong Province',
            'birth'=>'1932 ',
            'representative-works' => 'a Yi abalone',
            'height' => '179',
            'Gender '=>'male',
            'professional-position'=>'chef',
        ],
        '4' => [
            'id' => 4,
            'name' => 'Lu Yongliang',
            'Ethnic '=>'Han ',
            'Native-place' => 'Hubei Province',
            'birth'=>'1932 ',
            'representative-works' => 'sea cucumber wuchangyu',
            'height' => '176',
            'Gender '=>'male',
            'professional-position'=>'chef',
        ],
        '5' => [
            'id' => 5,
            'name' => 'Dong Zhenxiang',
            'Ethnic '=>'Han ',
            'Native-place' => 'Beijing',
            'birth'=>'1961 ',
            'representative-works' => 'northeast tiger fish',
            'height' => '181',
            'Gender '=>'male',
            'professional-position'=>'chef',
        ],
    ];

    public function findAll() {
        return $this->data;
    }

    public function find($id = null) {
        if (!empty($id) && isset($this->data[$id])) {
            return $this->data[$id];
        }
        return null;
    }

}
